home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 235 / Issue 235 - September 2007 - DPCS0907DVD.ISO / Extras / NetObjects Fusion / NOF10.exe / data1.cab / FSI / lib / nof / dialogs / ProgressDlg.js < prev    next >
Encoding:
Text File  |  2007-04-11  |  4.2 KB  |  123 lines

  1. /****i* SOURCE_FILE/INFO
  2.   *
  3.   * NAME
  4.   * ProgressDlg.js
  5.   *
  6.   * USAGE
  7.   *  Part of Netobjects JavaScript Library.
  8.   *
  9.   * COPYRIGHT
  10.   *  Copyright ⌐ 2000-2005 Website Pros, Inc.
  11.   *  All Rights Reserved.
  12.   *
  13.   *  This is an unpublished work protected by Website Pros, Inc.
  14.   *  as a trade secret, and is not to be used or disclosed except as
  15.   *  expressly provided in a written license agreement executed by
  16.   *  you and Website Pros, Inc.
  17.   *
  18.   *      <copyright@websitepros.com>
  19.   *
  20.   * NOTES
  21.   *  JavaScript code.
  22.   *
  23.   *****/
  24.  
  25. if (!IS.isModuleInitialized("IS.NOF.DIALOGS.ProgressDlg"))
  26. {
  27.   
  28.   /****h* NOF_JavaScript_Library/NOF.DIALOGS.ProgressDlg
  29.     *
  30.     * NAME
  31.     *  NOF.DIALOGS.ProgressDlg
  32.     *
  33.     * DESCRIPTION
  34.     *    
  35.     * The <code>ProgressDlg</code> class displays a progress dialog
  36.     * External dependencies: NOF.App
  37.     ****/
  38.   
  39.   /**
  40.     * constructor   
  41.     **/ 
  42.   function DIALOGS_ProgressDlg() {
  43.     this.__proto__ = DIALOGS_ProgressDlg.prototype;            
  44.   }
  45.   {
  46.     var member = DIALOGS_ProgressDlg.prototype;    
  47.     member.CLASS_NAME            = "DIALOGS.ProgressDlg";
  48.     
  49.     var method = DIALOGS_ProgressDlg.prototype;    
  50.     /*
  51.       open(String pTitle, String pText, int pMin, int pMax, boolean pPercent)
  52.       boolean close(int pTimeout)
  53.       boolean setMessage(String pMessage)
  54.       setRange(int pMin, int pMax)
  55.       boolean setPosition(int pPos)
  56.     */        
  57.     
  58.     /**
  59.     * Opens a progress dialog with title displayed in the title bar, 
  60.     * text displayed in the message field next to the progress bar. 
  61.     * The minimum and maximum values for the progress bar are specified by pMin and pMax. 
  62.     * If the progress bar should show percentage values rather than absolute values specify true for pPercent.
  63.     * The message text can be modified at any time by calling setMessage. 
  64.     * The minimum and maximum values can be set by calling setRange. 
  65.     * The position of the progress bar is set by calling setPosition. 
  66.     * The progress dialog is closed by calling close, see below. 
  67.     * The progress dialog is automatically closed when an script is completed if it hasn't already been closed.        
  68.     * 
  69.     * @param title specifies the text displayed in the title bar of the dialog.
  70.     * @param text specifies the text displayed in the dialog. 
  71.     * @param pMin
  72.     * @param pMax
  73.     * @param pPercent
  74.     **/
  75.     method.open = function (/*String*/ title,/*String*/ text, /*int*/ pMin, /*int*/ pMax, /*boolean*/ pPercent) {             
  76.       NOF.App.getFSIApp().OpenProgressDialog(title, text, pMin, pMax, pPercent);
  77.     }
  78.     
  79.     /**
  80.     * Closes the progress dialog.
  81.     *
  82.     * @param pTimeout specifies a number of milliseconds to wait before closing the dialog.
  83.     * @return true if the user has clicked the cancel button, otherwise it will return false.
  84.     **/
  85.     method.close = function (/*int*/ pTimeout) {             
  86.       return NOF.App.getFSIApp().CloseProgressDialog(pTimeout);                                
  87.     }
  88.     
  89.     /**
  90.     * Sets the message displayed next to the progress bar.
  91.     *
  92.     * @param text specifies the new text to be displayed in the dialog.
  93.     * @return true if the user has clicked the cancel button, otherwise it will return false.
  94.     **/
  95.     method.setMessage = function (/*String*/ text) {             
  96.       return NOF.App.getFSIApp().SetProgressMessage(text);                                
  97.     }
  98.     
  99.     /**
  100.     * sets the range for the progress bar. You also set the progress range when creating 
  101.     * the progress dialog, but this function may be needed if you show progress for 
  102.     * different operations where you reset the progress bar.
  103.     *
  104.     * @param pMin
  105.     * @param pMax
  106.     **/
  107.     method.setRange = function (/*int*/ pMin, /*int*/ pMax) {             
  108.       return NOF.App.getFSIApp().SetProgressRange(pMin, pMax);
  109.     }
  110.  
  111.     /**
  112.     * sets the position of the progress bar. This is relative to the minimum and maximum values 
  113.     * defined in open() or setRange().         
  114.     *
  115.     * @param pPos
  116.     * @return true if the user has clicked the cancel button, otherwise it will return false.
  117.     **/
  118.     method.setPosition = function (/*int*/ pPos) {             
  119.       NOF.App.getFSIApp().SetProgressPosition(pPos);
  120.     }
  121.   }
  122.   DIALOGS.__proto__.ProgressDlg = DIALOGS_ProgressDlg;
  123. }